<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/printer/printer.js"></script>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<br>' +
            '<ol class="breadcrumb">' +
            '<li>' +
            '<a>打印机</a>' +
            '</li>' +
            '<li>' +
            '<a>打印机</a>' +
            '</li>' +
            '<li>' +
            '<strong>修改打印机</strong>' +
            '</li>' +
            '</ol>';
    });
</script>

<body class="gray-bg">

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>修改</h5>
                    <ul class="nav navbar-top-links navbar-right">
                        <li>
                            <span class="m-r-sm text-muted welcome-message"><a
                                    href="javascript:window.history.back()"><i class="fa fa-home"></i> 返回</a></span>
                        </li>
                    </ul>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="frmEdit">
                        <input hidden id="id" name="id" value="${printer.id}">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">桩群名称:</label>
                            <div class="col-sm-8">
                                <c:forEach items="${pileGroups}" var="bean">
                                    <c:if test="${bean.priId == printer.id}">
                                        <input id="stationName" name="stationName" class="form-control" type="text"
                                               value="${bean.stationName}" readonly="readonly">
                                    </c:if>
                                </c:forEach>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">打印机逻辑地址:</label>
                            <div class="col-sm-8">
                                <input id="priRtua" name="priRtua" class="form-control" type="text"
                                       value="${printer.priRtua}" readonly="readonly">
                            </div>
                        </div>
                        <shiro:hasPermission name="system:printer:editStatus">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">打印机状态：</label>
                                <div class="col-sm-8">

                                    <select name="priStatus" id="priStatus"
                                            class="form-control chosen-select"
                                            style="width: 100%">
                                        <option value="1" ${printer.priStatus == "1" ? 'selected="selected"':''}>正常
                                        </option>
                                        <option value="2" ${printer.priStatus == "2" ? 'selected="selected"':''}>缺纸
                                        </option>
                                        <option value="3" ${printer.priStatus == "3" ? 'selected="selected"':''}>故障
                                        </option>
                                    </select>
                                </div>
                            </div>
                        </shiro:hasPermission>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">可打印次数：</label>
                            <div class="col-sm-8">
                                <input id="priTime" name="priTime" class="form-control"
                                       type="number" min="1" value="${printer.priTime}">
                            </div>
                        </div>
                        <%--  <div class="form-group">
                              <label class="col-sm-3 control-label">登录状态：</label>
                              <div class="col-sm-8">
                                  <select name="priLoginsatatus" id="priLoginsatatus"
                                          class="form-control chosen-select"
                                          style="width: 100%">
                                      <option value="0" ${printer.priLoginsatatus == "0" ? 'selected="selected"':''}>离线</option>
                                      <option value="1" ${printer.priLoginsatatus == "1" ? 'selected="selected"':''}>在线</option>
                                  </select>
                              </div>
                          </div>--%>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">警告提示数：</label>
                            <div class="col-sm-8">
                                <input id="warncount" name="warncount" class="form-control"
                                       type="number" min="1" value="${printer.warncount}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-success">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    editprinter.init();
</script>
</body>
</html>
